package com.qiaofang.applet.common.exception;

import com.qiaofang.applet.common.constant.ResponseCode;

/**
 * 业务异常
 * @author QF2019
 */
public class BusinessException extends RuntimeException {

    /**
     * 错误码
     */
    private int status;

    public BusinessException(int status, String msg, Throwable cause){
        super(msg, cause);
        this.status = status;
    }

    public BusinessException(){
        this(ResponseCode.FAIL.getStatus(), ResponseCode.FAIL.getMessage(), null);
    }

    public BusinessException(String msg){
        this(ResponseCode.FAIL.getStatus(), msg, null);
    }

    public BusinessException(int status, String msg){
        this(status, msg, null);
    }

    public BusinessException(Throwable cause){
        this(ResponseCode.FAIL.getStatus(), ResponseCode.FAIL.getMessage(), cause);
    }
}
